package com.danceforyou.order.service.impl;

import com.danceforyou.common.service.impl.BaseServiceImpl;
import com.danceforyou.order.dao.OrderCourseDAO;
import com.danceforyou.order.model.OrderCourseDO;
import com.danceforyou.order.service.OrderCourseService;
import com.danceforyou.order.vo.OrderCourseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* 类名称：OrderCourseServiceImpl
* 创建人：danceforyou
* 创建时间：2021年02月04日
* 版本号：1.0v
*/
@Service("orderCourseService")
public class OrderCourseServiceImpl extends BaseServiceImpl<Long, OrderCourseDO, OrderCourseVO, OrderCourseDAO> implements OrderCourseService {
    @Autowired
    private OrderCourseDAO orderCourseDAO;

    @Override
    public OrderCourseDAO getDao() {
        return orderCourseDAO;
    }

    @Override
    public void saveInfo(OrderCourseDO orderCourse) {
        this.insert(orderCourse);
    }

    @Override
    public void updateInfo(OrderCourseDO orderCourse) {
        this.update(orderCourse);
    }

    @Override
    public int deleteInfoByIds(String ids) {
        String[] idArr = ids.split(",");
        int i = 0;
        for (String id : idArr) {
            i += this.deleteById(id);
        }
        return i;
    }
}
